home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
PROGEDIT
/
0748.ZIP
/
PARA
< prev
next >
Wrap
Text File
|
1986-12-29
|
891b
|
43 lines
/* These macros move up and down one paragraph. C programmers who want */
/* to move up and down one function can alter these macros. */
init()
{
assign_key("downpara", 14);
assign_key("uppara", 16);
}
downpara()
{
while (!is_line_blank(currline()) && currlinenum() < lastlinenum())
down();
while (is_line_blank(currline()) && currlinenum() < lastlinenum())
down();
}
uppara()
{
if (!is_line_blank(currline()))
up(); /* don't get stuck at first line of para */
while (is_line_blank(currline()) && currlinenum() > 1)
up();
while (!is_line_blank(currline()) && currlinenum() > 1)
up();
if (currlinenum() > 1)
down();
}
is_line_blank(str)
string str;
{
int i;
int len;
len = strlen(str);
for (i = 1; i <= len; i = i + 1)
if (substr(str, i, 1) != " ")
return 0;
return 1;
}